<!DOCTYPE html>
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 
	<title>map</title>
	<style type="text/css">
	* {
		padding: 0;
		margin: 0;
	}
    </style>
</head>
<body>
	<div class="container">
		<h1>map</h1>
		<div class="box">
		    <button message="后盾人">button</button>
		    <button message="hdcms">button</button>
		</div>
	</div>
	<script src="index.js"></script>
	<script type="text/javascript">
		const btnMap = new Map();

		document.querySelectorAll('button').forEach((btn, index) => {
			// 在此处配置dom元素的自定义配置
			btnMap.set(btn, {
				message: btn.getAttribute('message'),
				title: '自定义的配置 '+ index
			})
			btn.addEventListener('click', function() {
				console.log(btnMap.get(this))
			})
		})

	</script>
</body>
</html>